var app = getApp();

Page({
    data: {},
    onLoad: function(t) {
        this.getBase(), this.getUser();
    },
    getBase: function() {
        var e = this;
        app.util.request({
            url: "entry/wxapp/Base",
            success: function(t) {
                console.log(t), e.setData({
                    base: t.data.data
                });
            }
        });
    },
    getUser: function() {
        var e = this;
        app.util.request({
            url: "entry/wxapp/User",
            data: {
                openid: wx.getStorageSync("openid")
            },
            success: function(t) {
                console.log(wx.getStorageSync("openid")), console.log(t), e.setData({
                    userinfo: t.data.data
                });
            }
        });
    },
    caozuozhinan: function(t) {
        var e = t.currentTarget.dataset.url;
        wx.navigateTo({
            url: "../outerlink/outerlink?url=" + e
        });
    },

    // 我的评价
    myPingClick: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "/hyb_jianzhi/my_ping/my_ping"
        });
    },

    editClick: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "/hyb_jianzhi/edit/edit"
        });
    },

    // 四个状态
    applyClick: function(t) {
        this.getform(t.detail.formId);
        var e = t.currentTarget.dataset.index;
        wx.navigateTo({
            url: "/hyb_jianzhi/apply/apply?index=" + e
        });
    },

    // 我的钱包
    walletClick: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "/hyb_jianzhi/wallet/wallet"
        });
    },

    // 打客服电话
    callPhone: function(t) {
        this.getform(t.detail.formId), wx.makePhoneCall({
            phoneNumber: t.currentTarget.dataset.phone
        });
    },

    // 商家中心
    shopClick: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "/hyb_jianzhi/shop/shop"
        });
    },

    // 平台公告
    help: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "/hyb_jianzhi/yue/yue"
        });
    },

    // 使用帮助
    help2: function (t) {
      this.getform(t.detail.formId), wx.navigateTo({
      url: "/hyb_jianzhi/yue2/yue2"
    });
  },

    // 商家审核中
    shopClick2: function(t) {
        this.getform(t.detail.formId), wx.showToast({
            title: "审核中",
            image: "/hyb_jianzhi/images/errors.png"
        });
    },

    // 未入住的
    shopClick3: function(t) {
        this.getform(t.detail.formId), wx.showToast({
            title: "请先入驻",
            image: "/hyb_jianzhi/images/errors.png"
        }), setTimeout(function() {
            wx.navigateTo({
                url: "/hyb_jianzhi/shop_edit/shop_edit?typs=ruzhu"
            });
        }, 1e3);
    },

    // 我的收藏
    collect: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "../collect/collect"
        });
    },

    // 分享赚钱
    sell: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "/hyb_jianzhi/sell/sell"
        });
    },


    getform: function(t) {
        console.log(t), app.util.request({
            url: "entry/wxapp/Formid",
            data: {
                openid: wx.getStorageSync("openid"),
                formid: t
            },
            success: function(t) {}
        });
    },

    // vip申请
    addvip: function(t) {
        this.getform(t.detail.formId), wx.navigateTo({
            url: "../addvip_user/addvip_user"
        });
    },

    onReady: function() {},
    onShow: function() {
        this.getBase(), this.getUser();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});